import requests from './ajax';

// export const reqProfileList = () => {
//   return mockRequests.get('/profile');
// };
export const reqProfileList = () => {
  return requests.get('/academies/distribute');
};
export const reqProfile2List = () => {
  return requests.get('/offices/distribute');
};
export const reqAreaList = () => {
  return requests.get('/academies/area');
};
export const reqGradeList = () => {
  return requests.get('/offices/grades');
};
export const reqAcademies = (id) => {
  return requests.get('/academies/' + id);
};
export const reqOffices = (id) => {
  return requests.get('/offices/' + id);
};
export const reqItemList = (id) => {
  return requests.get('/items/listFixed/' + id);
};
export const reqOfficeItemList = (id) => {
  return requests.get('/items2/listFixed/' + id);
};
export const reqAllItemList = (id) => {
  return requests.get('/items/listAll/' + id);
};
export const reqAllOfficeItemList = (id) => {
  return requests.get('/items2/listAll/' + id);
};
export const reqItem = (id) => {
  return requests.get('/items/getItem/' + id);
};
export const reqOfficeItem = (id) => {
  return requests.get('/items2/getItem/' + id);
};
export const reqSearch = (name) => {
  return requests.get('/academies/search/' + name);
};
export const reqRecommend = () => {
  return requests.get('/academies/introduce');
};
export const reqRecommend2 = () => {
  return requests.get('/offices/introduce');
};
export const reqNewItemInfo = (params) => {
  console.log(params);
  requests.post('/changes', params).then(
    (res) => {
      // console.log('请求结果' + res.json);
      console.log('新增成功' + res + this);
    },
    (error) => {
      console.log(error);
    }
  );
};

export const reqABlogOneList = (id) => {
  return requests.get('/blogs/blogOneList/' + id);
};
export const reqABlogCommentList = (id) => {
  return requests.get('/blogs/comment/' + id);
};

export const reqCommentFirst = (bolgId) => {
  return requests.get('/blogs/commentFirst/' + bolgId);
};
export const reqBlogsIsLike = (bolgId) => {
  return requests.get('/blogs/like/judge/' + bolgId);
};
export const reqAcademyIsLike = (academyId) => {
  return requests.get('/collects/academy/judge/' + academyId);
};
//new
export const reqOfficeIsLike = (officeId) => {
  return requests.get('/collects/office/judge/' + officeId);
};

export const reqBlogsIsCollect = (bolgId) => {
  return requests.get('/collects/blog/judge/' + bolgId);
};
export const reqBlogsList = () => {
  return requests.get('/blogs/list');
};
export const reqUserInfo = () => {
  return requests.get('/users/userMassage');
};
export const reqPoint1 = () => {
  return requests.get('/visual/getPoint1');
};
export const reqLink1 = () => {
  return requests.get('/visual/getLink1');
};
export const reqAcademyPoint = (id) => {
  console.log(id);
  return requests.get('/visual/getAcademyPoint/' + id);
};
export const reqAcademyLink = (id) => {
  return requests.get('/visual/getAcademyLink/' + id);
};
//TODO
export const reqOfficePoint = (id) => {
  console.log(id);
  return requests.get('/visual2/getOfficePoint/' + id);
};
export const reqOfficeLink = (id) => {
  return requests.get('/visual2/getOfficeLink/' + id);
};
// /academies/distribute/{}/{}/{}
export const reqAcademiesList = (province, page, pageSize) => {
  return requests.get(
    '/academies/distribute/' + province + '/' + page + '/' + pageSize
  );
};
// /offices/distribute/{}/{}/{}
export const reqOfficesList = (dynasty_grade, page, pageSize) => {
  return requests.get(
    '/offices/distribute/' + dynasty_grade + '/'+ page + '/' + pageSize
  );
};

// export const reqCommentTwo = (bolgId, parentCommentId) => {
//   return requests.get('/blogs/commentTwo/' + bolgId + '/' + parentCommentId);
// };

// 当前这个函数需不需要接受外部传递参数,这里我们给了一个params
// 当前这个接口，给服务器传递参数params，至少是一个空对象
// export const reqGetItemInfo = (params) => {
//   requests({
//     url: '/changes',
//     methods: 'post',
//     data: params,
//   });
// };
// export const reqGetSearchInfo = (params) => {
//   requests({
//     url: '/list',
//     methods: 'post',
//     data: params,
//   });
// };
